package com.atguigu.springcloud.cloudsentinelgatewaydevelop.mapper;

import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule;
import org.springframework.data.r2dbc.repository.Modifying;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import reactor.core.publisher.Mono;

import java.util.List;

public interface ParamFlowRuleMapper extends ReactiveCrudRepository<List<String>,List<ParamFlowRule>> {

    @Modifying
    @Query("delete from sentinel_param_flow_rule spfr where spfr.id = :id")
    Mono<Integer> deleteByID(Long id);

    @Modifying
    @Query("delete from sentinel_param_flow_rule spfr where spfr.application_name = :applicationName")
    Mono<Integer> deleteByAyApplicationName(String applicationName);
}
